<?php
$sql_bbsff  =$db->query('plugin_caiji',"`zdcjsz` ='1' and `zdcjsj` < '$time_mt' ORDER BY `id` DESC LIMIT 0,1",'');
while($row=mysql_fetch_array($sql_bbsff)){

###############   
   $urllkk=$row[url];
   $c=Bingz_collection($urllkk);
   if($row[yycj3]){
      $preg  = '@'.$row[yycj1].'(.*?)'.$row[yycj2].'(.*?)'.$row[yycj3].'@is' ;
   }else{
      $preg  = '@'.$row[yycj1].'(.*?)'.$row[yycj2].'@is' ;
   }
   preg_match_all ($preg,$c,$zzza);
   $bsb='1';
   foreach($zzza[1] as $a=> $lists){
    $urlla =$row['zzurl'].$lists.$row['zzurla'];
    $ab=Bingz_collection($urlla);
    preg_match('@'.$row[cccj1].'(.*?)'.$row[cccj2].'@i',$ab,$tit1);
    preg_match('@'.$row[cccj3].'(.*?)'.$row[cccj4].'@s',$ab,$tit2);
    $tit2[1]=str_replace('</p>','
    ',$tit2[1]);
    if(!$row[cccj3]){$tit2[1]=$tit1[1];}
      	 	$time=time();
      	 	if($tit1[1] && $tit2[1]){
      	    if($row[lx] == 1){
      	 	   $tit1[1]=iconv($row[bianm],'utf-8',strip_tags($tit1[1]));
      	     if($db->get_one('forum_class'," `id` ='$row[cid]' ",'')){
      	       if(!$db->get_one('forum'," `cid` ='$row[cid]' AND `name` ='$tit1[1]'",'')){
                 ###########
                 $name='';
                 $fmpuid='';
                 if(!$row[cccj3]){
                 	if(preg_match('@'.$row[img_a].'(.*?)'.$row[img_b].'@',$ab,$name)){
                    if($fmpuid=Bingz_forum_upload_post($row[uid],$row[img_url].$name[1].$row[img_urla])){
               	     	 $tit2[1]='[attach]'.$fmpuid.'[/attach]///'.$tit2[1];
               	    }
                  }
                 }else{
                 	if(preg_match('@'.$row[img_a].'(.*?)'.$row[img_b].'@',$tit2[1],$name)){
                    if($fmpuid=Bingz_forum_upload_post($row[uid],$row[img_url].$name[1].$row[img_urla])){
               	     	 $tit2[1]=str_replace($name[0],'[attach]'.$fmpuid.'[/attach]',$tit2[1]);
               	    }
                  }
                 }
                 ###########
                 $tit2[1]=iconv($row[bianm],'utf-8',strip_tags($tit2[1]));
                 Bingz_forum_post($row[cid],$row[uid],$tit1[1],$tit2[1]);
                 $asa++;
               }
             }
      	    }
      	 	}else{
      	  }
     $bsb++;
     if($bsb > $row[ggyid]){ break; }
   }
#########################
   $timesj=strtotime(date("Y-m-d H:i:s",strtotime(" +1 day")));
   $db->update('plugin_caiji',array('zdcjsj' => $timesj ),"`id` ='$row[id]'");
}
?>